﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;

namespace MobilesStore.Domain.Entities
{
    public class Product
    {
        [HiddenInput(DisplayValue = false)]
        public int ProductID { get; set; }

        [Required(ErrorMessage="Please Enter Product Name")]
        [DisplayName("Product Name")]
        [StringLength(100, ErrorMessage = "Product Name cannot exceed 100 chars")]
        public String ProductName { get; set; }

        [DataType(DataType.MultilineText)]
        [DisplayName("Product Description")]
        [Required(ErrorMessage="Please Enter Product Description")]
        [StringLength(500, ErrorMessage = "Product Description cannot exceed 500 chars")]
        public String ProductDescription { get; set; }

        [Required]
        [Range(0.01, double.MaxValue, ErrorMessage = "Please enter a positive price")]
        [DisplayName("Product Price")]
        public Decimal ProductPrice { get; set; }

        [Required(ErrorMessage = "Please specify a category")]
        [DisplayName("Product Category")]
        [StringLength(50, ErrorMessage = "Description cannot exceed 50 chars")]
        public String ProductCategory { get; set; }

        public byte[] ImageData { get; set; }

        [HiddenInput(DisplayValue = false)]
        public string ImageMimeType { get; set; }

        [Required(ErrorMessage="Please Enter Quantity")]
        [DisplayName("Product Quantity")]
        [Range(1,Int32.MaxValue,ErrorMessage="Please Enter a Valid Quantity")]
        public int Quantity { get; set; }
    }
}
